package common.com.androidbase.datarequest;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * 搜索结果中pgc账户信息
 *
 * @author shaohualiu
 */
public class PgcAccountInfoModel implements Parcelable {

    private int data_type;
    private String nickname;
    /**
     * 用户头像
     */
    private long user_id = -1;
    private String small_pic;
    private long total_fans_count;
    private String total_fans_count_tip;
    private String url_html5;
    private long total_video_count;
    private long total_play_count;
    private String gold_logo;
    /**
     * pgc的横屏h5主页地址
     */
    private String hor_url_html5;
    private int verified;
    private String user_desc;

    private String main_title;
    private String sub_title;
    private String corner_title;
    private String bottom_title;
    private int template_id;

    private int feeded;

    private long uid;
    private int subscribed;

    private int is_attention = -1;
    private List<AppPlatformVideoModel> videos;

    public PgcAccountInfoModel() {
        super();
    }

    public int getData_type() {
        return data_type;
    }

    public void setData_type(int data_type) {
        this.data_type = data_type;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getSmall_pic() {
        return small_pic;
    }

    public void setSmall_pic(String small_pic) {
        this.small_pic = small_pic;
    }

    public long getTotal_fans_count() {
        return total_fans_count;
    }

    public void setTotal_fans_count(long total_fans_count) {
        this.total_fans_count = total_fans_count;
    }

    public String getTotal_fans_count_tip() {
        return total_fans_count_tip;
    }

    public void setTotal_fans_count_tip(String total_fans_count_tip) {
        this.total_fans_count_tip = total_fans_count_tip;
    }

    public String getUrl_html5() {
        return url_html5;
    }

    public void setUrl_html5(String url_html5) {
        this.url_html5 = url_html5;
    }

    public long getTotal_video_count() {
        return total_video_count;
    }

    public void setTotal_video_count(long total_video_count) {
        this.total_video_count = total_video_count;
    }

    public long getUser_id() {
        return user_id;
    }

    public void setUser_id(long user_id) {
        this.user_id = user_id;
    }

    public String getHor_url_html5() {
        return hor_url_html5;
    }

    public void setHor_url_html5(String hor_url_html5) {
        this.hor_url_html5 = hor_url_html5;
    }

    public int getVerified() {
        return verified;
    }

    public void setVerified(int verified) {
        this.verified = verified;
    }

    public boolean isVerified() {
        return verified == 1;
    }

    public String getUser_desc() {
        return user_desc;
    }

    public void setUser_desc(String user_desc) {
        this.user_desc = user_desc;
    }

    public String getMain_title() {
        return main_title;
    }

    public void setMain_title(String main_title) {
        this.main_title = main_title;
    }

    public String getSub_title() {
        return sub_title;
    }

    public void setSub_title(String sub_title) {
        this.sub_title = sub_title;
    }

    public String getCorner_title() {
        return corner_title;
    }

    public void setCorner_title(String corner_title) {
        this.corner_title = corner_title;
    }

    public String getBottom_title() {
        return bottom_title;
    }

    public void setBottom_title(String bottom_title) {
        this.bottom_title = bottom_title;
    }

    public int getTemplate_id() {
        return template_id;
    }

    public void setTemplate_id(int template_id) {
        this.template_id = template_id;
    }

    public void setFeeded(int feeded) {
        this.feeded = feeded;
    }

    public int getFeeded() {
        return feeded;
    }

    public int getIs_attention() {
        return is_attention;
    }

    public void setIs_attention(int is_attention) {
        this.is_attention = is_attention;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public PgcAccountInfoModel(Parcel source) {
        data_type = source.readInt();
        nickname = source.readString();
        small_pic = source.readString();
        total_fans_count = source.readLong();
        total_fans_count_tip = source.readString();
        url_html5 = source.readString();
        total_video_count = source.readLong();
        total_play_count = source.readLong();
        user_id = source.readLong();
        hor_url_html5 = source.readString();
        verified = source.readInt();
        user_desc = source.readString();

        main_title = source.readString();
        sub_title = source.readString();
        corner_title = source.readString();
        bottom_title = source.readString();
        template_id = source.readInt();

        feeded = source.readInt();

        uid = source.readLong();
        subscribed = source.readInt();
        videos = source.createTypedArrayList(AppPlatformVideoModel.CREATOR);
        is_attention = source.readInt();
        gold_logo = source.readString();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(data_type);
        dest.writeString(nickname);
        dest.writeString(small_pic);
        dest.writeLong(total_fans_count);
        dest.writeString(total_fans_count_tip);
        dest.writeString(url_html5);
        dest.writeLong(total_video_count);
        dest.writeLong(total_play_count);
        dest.writeLong(user_id);
        dest.writeString(hor_url_html5);
        dest.writeInt(verified);
        dest.writeString(user_desc);

        dest.writeString(main_title);
        dest.writeString(sub_title);
        dest.writeString(corner_title);
        dest.writeString(bottom_title);
        dest.writeInt(template_id);

        dest.writeInt(feeded);

        dest.writeLong(uid);
        dest.writeInt(subscribed);
        dest.writeTypedList(videos);
        dest.writeInt(is_attention);
        dest.writeString(gold_logo);
    }

    /**
     * Intent传递时序列化
     */
    public static final Creator<PgcAccountInfoModel> CREATOR = new Creator<PgcAccountInfoModel>() {

        @Override
        public PgcAccountInfoModel[] newArray(int size) {
            return new PgcAccountInfoModel[size];
        }

        // 将Parcel对象反序列化为Parcelable
        @Override
        public PgcAccountInfoModel createFromParcel(Parcel source) {
            return new PgcAccountInfoModel(source);
        }
    };

    public long getTotal_play_count() {
        return total_play_count;
    }

    public void setTotal_play_count(long total_play_count) {
        this.total_play_count = total_play_count;
    }

    public List<AppPlatformVideoModel> getVideos() {
        return videos;
    }

    public void setVideos(List<AppPlatformVideoModel> videos) {
        this.videos = videos;
    }

    public int getSubscribed() {
        return subscribed;
    }

    public void setSubscribed(int subscribed) {
        this.subscribed = subscribed;
    }

    public boolean isSubscribed() {
        return subscribed == 0 ? false : true;
    }

    public long getUid() {
        return uid;
    }

    public void setUid(long uid) {
        this.uid = uid;
    }

    public String getGold_logo() {
        return gold_logo;
    }

    public void setGold_logo(String gold_logo) {
        this.gold_logo = gold_logo;
    }
}
